<%@page import="com.zch.news.entity.User"%>
<%@page import="com.zch.news.entity.News"%>
<%@ page language="Java" contentType="text/html;charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head> 
    <title>普通用户</title>        
  <meta http-equiv="content-Type" content="text/html;charset=utf-8"> 
  <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  <meta http-equiv="description" content="this is a page">
  <link rel="stylesheet" href="./css/..." type="text/css">
  <script language="javascript" type="text/javascript" src="./js/..."></script> 
 </head>
 <body>
 	<table border="1">
 			<tr>
 				<th>新闻编号</th>
 				<th>新闻标题</th>
 				<th>新闻内容</th>
 				<th>作者</th>
 				<th>创建日期</th>
 			</tr>
 	<%	
 		//得到session里面存放的普通用户的信息
 		User user = (User)session.getAttribute("user1");
 		List<News> list = (List<News>)session.getAttribute("list");
 		for(int i = 0; i < list.size(); i++){
 			News news = list.get(i);
 	%>
 			<tr>
 				<td><%=news.getNo() %></td>
 				<td><%=news.getTitle() %></td>
 				<td><%=news.getContent() %></td>
 				<td><%=news.getAuthor() %></td>
 				<td><%=news.getCreatTime() %></td>
 			</tr>
 			<%} %>
 		</table>
 		<input type="button" onclick="window.location='updateUser.jsp?userName=<%=user.getPhone() %>'" value="修改账户密码">
 </body>
</html>